const mixins = require('../../../mixins/message');
var app = getApp();
const options = {


  /**
   * 页面的初始数据
   */
  data: {
    messageList: [],
    page: 1,
    isNull: true,
    loadmore: true,
    loadmoreShow: false,
    isLastPage: false,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.getDetailsMessages(1);
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    this.readMessages(1);
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    wx.stopPullDownRefresh();
  },


  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    let that = this;
    that.setData({
      loadmoreShow: true,
      page: that.data.page + 1
    });
    that.getDetailsMessages(1);
  },
}
mixins(options)
Page(options)